<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>template制作模板</title>
    <script type="text/javascript" src="../assets/js/vue-2.3.0.js"></script>
</head>

<body>
    <h1>template三种写法</h1>
    <hr>
    <div id="app">
        {{message}}
    </div>

    <!-- 方法2 -->
    <template id="demo2">
        <div style="color:#ff0033;">这是标签模板</div>
    </template>

    <!-- 方法3 -->
    <script x-template id="demo3">
        <div style = "color:orange;" > 这是script标签模板 </div>
    </script>
</body>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            message: '这是选项模板'
        },
        // template: '#demo3' //调用方法2，3
        //方法1
        template:`<div style="color:#ff0033;">这是选项模板</div>`
    })
</script>

</html>